Ext.define("wmf.view.blacklist.Edit", {
    extend: "wmf.lib.FormPanel",
    alias: "widget.blacklistEdit",
    anchor: '100% 100%',
    border: false,
    autoScroll: true,
    fieldDefaults: {
        labelWidth: 90
    },
    
    items:[{
		xtype: "radiogroup",
		fieldLabel: "选择操作类型",
		border: 0,
		items: [
			{ boxLabel: "添加", name: "operateType", width:50, inputValue: "1", checked: true},
			{ boxLabel: "删除", name: "operateType", inputValue: "2" }
		]
    },{
		xtype: "textfield",
		name: "reason", 
		vtype: 'shopDetailAddress',
		fieldLabel: "操作原因"
	},{
		xtype:'fieldcontainer', 
		combineErrors: true,
        msgTarget : 'side',
        layout: 'hbox',
		items:[{
		    xtype: "textfield",
			name: "blackItem", 
			id: "blackItem", 
			vtype: 'tel',
			flex: 3,
			fieldLabel: "输入号码",
			listeners : {
		        'change' : function(){
		                var valMob=Ext.getCmp('blackItem').getValue();
		                if(valMob!="" && (/^\d+$/.test(valMob)&&valMob.length==11)){
		                 Ext.getCmp('submitMobile').setDisabled(false);
		                }else{
		                 Ext.getCmp('submitMobile').setDisabled(true);
		                }
		                 
		              }
		         }
		},{
		    xtype: "button",
			itemId: "submitMobile", 
			id: "submitMobile", 
			text: "提交",
			width: 100,
			margins:"0 5 0 5"
			//formBind: true
		}]
	},{ 
		xtype:'fieldcontainer', 
		combineErrors: true,
        msgTarget : 'side',
        layout: 'hbox',
		items:[{
			xtype: 'filefield',
			name: 'blacklistFile',
			fieldLabel: '选择上传文件',
			flex: 3,
			validator: function(value){
				var arr = value.split('.');
				if(arr[arr.length-1] != 'txt'){
					return '文件不合法！！！';
				}else{
					return true;
				}
			},
			//allowBlank: false,
			buttonText: '选择文件'
		},{
		    xtype: "button",
			itemId: "submitFile", 
			width: 100,
			formBind: true,
			margins:"0 5 0 5",
			text: "提交"
		}]
	}],
    
	dockedItems: [{
		xtype: 'toolbar',
		dock: 'bottom',
		layout: {
				type: 'hbox',
				alian: 'center',
				flex: 1
		},
		
		defaults: {
				xtype: 'button'
		},
		items: [{
				xtype : 'tbfill'
		},/*{
				itemId: 'upload',
				icon: 'resources/icons/pencil.png',
				formBind: true,
				text: "编辑"
		},{
				itemId: 'reset',
				icon: 'resources/icons/restart.png',
				formBind: true,
				text: "重置"
		},*/{
				itemId: 'cancel',
				icon : 'resources/icons/icon_revoke.png',
				text: translations.global.operation.cancel
		}]
	}]
});